package com.mmz.gulimall.search.vo;

import com.mmz.common.to.SkuEsModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 检索后返回页面的数据
 * @author mangmangguai
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SearchResult {
    /**
     * 查询到的所有商品信息
     */
    private List<SkuEsModel> products;

    /**
     * 分页信息:当前页码、总记录数、总页码
     */
    private Integer pageNum;
    private Long total;
    private Integer totalPages;

    /**
     * 当前查询到的结果，所有涉及的品牌
     */
    private List<BrandVo> brands;

    /**
     * 当前查询到的结果，所有涉及的所有属性
     */
    private List<AttrVo> attrs;
    /**
     * 当前查询到的结果，所有涉及的所有分类
     */
    private List<CatalogVo> catalogs;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class BrandVo{
        private Long brandId;
        private String name;
        private String logo;
    }
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AttrVo{
        private Long attrId;
        private String attrName;
        private List<String> attrValue;
    }
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class CatalogVo{
        private Long catalogId;;
        private String catalogName;
    }
}
